#include "address.h"

void test(){
    std::vector<Address::ptr> addrs;
    Address::Lookup(addrs, "www.baidu.com");
    for(int i = 0; i < addrs.size(); i ++){
        std::cout<<i<<" - "<<addrs[i]->toString()<<std::endl;
    }
}

void iface(){
    std::multimap<std::string, std::pair<Address::ptr, uint32_t>> results;
    bool v = Address::GetInterfaceAddresses(results);
    if(!v){
        std::cout<< "error"<<std::endl;
        return;
    }
    for(auto& i : results){
        std::cout << i.second.first->toString()<<" "<<i.second.second<<std::endl;
    }
}

int main(int argc, char** argv){
    //test();
    iface();
    return 0;
}
